<template>
  <div class="main">
    <div class="searchBox clearfix">    
    	<div class="searchContent ">
    		<el-input
			  placeholder="业主名称"
			  v-model="param.customName"
			  clearable>
			</el-input>
			<el-input
			  placeholder="手机号码"
			  v-model="param.customIdCard"
			  clearable>
			</el-input>		
			<el-button @click="searchList">查找</el-button>    		
    	</div>    	
    </div>
    <div class="tableList">
	    <el-table :data="list.data.rows" row-key="id" border  >
	        <el-table-column label="姓名" > 
	           <template slot-scope="scope">
	                <span>{{ scope.row.customName }}</span>
	            </template>           
	        </el-table-column>        
	        <el-table-column label="手机号">
	            <template slot-scope="scope">
	                <span>{{ scope.row.customName }}</span>
	            </template>
	        </el-table-column>

	        <el-table-column label="身份证号码">
	            <template slot-scope="scope">
	                <span>{{ scope.row.customName }}</span>
	            </template>
	        </el-table-column>
	        <el-table-column label="审核状态">
	            <template slot-scope="scope">
	                <span>{{ scope.row.customName }}</span>
	            </template>
	        </el-table-column>
	        <el-table-column label="申请时间">
	            <template slot-scope="scope">
	                <span>{{ scope.row.customName }}</span>
	            </template>
	        </el-table-column>
	        <el-table-column  label="操作">
		      <template slot-scope="scope">
		        <el-button
		          size="mini"
		          class="orangeBtn"
		          @click="Reject(scope.$index, scope.row)">驳回</el-button>
		        <el-button
		          size="mini"
		          type="danger"
		          class="greenBtn"
		          @click="Pass(scope.$index, scope.row)">通过</el-button>
		      </template>
		    </el-table-column>
	       
	    </el-table>
    </div>  
    <div class="pagination">   
         <el-pagination
            @size-change="changeNum"
            @current-change="changePage"
            :current-page="param.pageNum"
            :page-sizes="[10, 20, 30, 40]"
            :page-size="param.pageSize"
            layout="total, prev, pager, next,sizes"
            :total="list.data.total">
        </el-pagination>
    </div>


  </div>
</template>

<script>
import { mapState } from 'vuex';
import showImg from '@/components/showImg';

export default {
	name: 'leasingInfo',
	components:{showImg},
	data () {
		return {
			dialogShowImg:false,			
			idNum:'',
			url:'/CustomOrderManageController/obtainCustomOrderInfo',
			param: {							
				regionCode:JSON.parse(localStorage.getItem('regionCode')),                          
	            pageNum: 1,
	            pageSize: 10,                    
	            hotelName:null,                                  
	            entryTimeStr:null,
	            leaveTimeStr: null, 
	            customName:null,
	            customIdCard:null


	          
			},			  				
			
		}
	},
	methods: { 	


	 	changeNum(val) {   
	 		this.param.pageNum=1;        
	        this.param.pageSize = val; 
	        this.$store.dispatch('getlist',{param:this.param,url:this.url});       
	    },
	    changePage(val) { 
	        this.param.pageNum=val;   
	       this.$store.dispatch('getlist',{param:this.param,url:this.url});       
	       
	    }, 
	    tableList(){
	    	this.$store.dispatch('getlist',this.param);
	    },
	    showPic(id){
	    	this.dialogShowImg=true;
	    	this.$refs.detailDialog.loadDialogData(id);	    	
	    },
	    Reject(index,row){
			this.$confirm('确定驳回该业主信息？')
			.then(_ => {
				
			})
			.catch(_ => {
				
			});

	    },
	    Pass(index,row){
			this.$confirm('确定通过该业主信息？')
			.then(_ => {
				

			})
			.catch(_ => {
				
			});

	    },
	    searchList(){
	    	this.$store.dispatch('getlist',{param:this.param,url:this.url}); 
	    }	    
	},
	created() {   	
       this.$store.dispatch('getlist',{param:this.param,url:this.url});             
    },
    computed:{
    	...mapState(['list'])
    }
}
</script>
<style scoped>

</style>
